<template>
<div>
    <Modal v-model="data.isShow" :mask-closable='false'>
        <p slot="header">添加企业</p>
        <div style="margin-top: 10px; padding-right: 20px;">
            <Form ref="formInline" :model="data.data" :rules="ruleInline" :label-width="80">
                <FormItem prop="user" label="公司名称">
                    <Input type="text" v-model="data.data.neme" placeholder="请输入公司名称">
                    </Input>
                </FormItem>
                <FormItem prop="time" label="添加日期">
                    <Input type="text" v-model="data.data.time" placeholder="请输入公司名称">
                    </Input>
                </FormItem>
            </Form>
        </div>
        <div slot="footer">
            <Button type="primary" @click="handleSubmit" size="large" :loading="data.isLoading">确定</Button>
        </div>
    </Modal>
</div>
</template>

<script>
export default {
    props:['data'],
    data() {
        return {
            ruleInline: {}
        }
    },
    methods: {
        handleSubmit() {
            this.$refs['formInline'].validate((valid) => {
                if (valid) {
                    this.$emit('on-submit', this.data);
                } else {
                    this.$Message.error('请输入必填项!');
                }
            })
        }
    },
}
</script>

<style lang="less" scopedSlots>

</style>
